<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <title>注册</title>
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
    <script src="__PUBLIC__/js/jquery.min.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/bootstrap.min.js" type="text/javascript"></script>
    <script>
        function cheak()
        {
            if(!cheakname())
            {
                alert("用户名不能为空");
                return false;
            }
            if(!cheakpassword())
            {
                alert("密码未填写！");
                return false;
            }
            if(!cheakser())
            {
                alert("未同意服务！");
                return false;
            }
            if(!cheaksex())
            {
                alert("未填写性别！");
                return false;
            }
            return true;
        }
        function cheakname(){
            var name=document.getElementsByName('username')[0];
            var val=name.value;
            if(val==''||val==null){
                return false;
            }else{
                return true;
            }
        }
        function cheakpassword()
        {
            var password1=document.getElementsByName('password1')[0].value;
            var password2=document.getElementsByName('password2')[0].value;
            if(password1!=password2)
            {
                alert("密码不一致");
                document.getElementsByName('password2')[0].style.cssText="border:1px solid red";
                return false;
            }else{
                document.getElementsByName('password2')[0].style.cssText="border:1px solid #cccccc";
                return true;
            }
        }
        function cheakser()
        {
            var ser=document.getElementsByName('serpro')[0];
            if(ser.checked)
                return true;
            else
                return false;
        }
        function cheaksex()
        {
            var ser=document.getElementsByName('optionsRadios')[0];
            if(ser.checked)
                return true;
            else
                return false;
        }

    function change()
    {
        var search=document.getElementById('search').value;
        var bai="https://www.baidu.com/s?wd=";
        var du="&rsv_spt=1&rsv_iqid=0xe97675fb000043b6&issp=1&f=8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=1&rsv_sug3=7&rsv_sug1=6&rsv_sug7=101&rsv_t=227044TtS9qeVu8DAwk3ZSRFoH0OCKcFn7aK2yg0FtoXphUMxQ1ShqgoJUegsgxUMyh1&rsv_sug2=0&inputT=5449&rsv_sug4=5449"
        var baidu=bai+search+du;
        //window.location.href=baidu;
        window.open(baidu);
    }
    </script>
</head>
<body>
<nav class="nav navbar-default" role="navigation">

    <div class="container-fluid" style="background-color:#563d7c">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="home_page.html" class="navber-link">首页</a></li>
                <li><a href="me.html" class="navber-link">个人资料</a></li>
                <li><a href="#" class="navber-link">问题咨询</a></li>
            </ul>
            <div class="navbar-form navbar-right">
                <input id='search' type="text" class="form-control" placeholder="想知道什么">
                <button class="btn btn-group"  onclick="change()">搜  索</button>
            </div>
        </div>
    </div>
</nav>
<div class="container" >
    <center><h1 class="page-header">用户注册</h1></center>
    <form class="form-horizontal" method="POST" action='__URL__//regist' onsubmit="return cheak()" >
        <div class="form-group">
            <div class="col-md-3"></div>
            <div class="col-md-6">
                <input name="username" onblur="cheakname()" type="text" class="form-control" placeholder="用户名/email">
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3"></div>
            <div class="col-md-6">
                <input name="signature" type="text" class="form-control" placeholder="个性签名">
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3"></div>
            <div class="col-md-6"><input type="text" name="useradd"class="form-control" placeholder="家庭住址">
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3"></div>
            <div class="col-md-6">
                <input type="password" class="form-control" name="password1"placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3"></div>
            <div class="col-md-6">
                <input type="password" class="form-control" name="password2"placeholder="确认密码" onblur="cheakpassword()">
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3"></div>
            <div class="col-md-6">
                <input type="text" class="form-control" name="contact"placeholder="联系电话">
            </div></div>
        <div class="form-group" >
            <div class="col-md-3"></div>
            <label class="col-sm-3 control-label" style="color:#666666">性&nbsp;&nbsp;别：</label>
            <div class="col-md-6">
                <label class="radio-inline" style="color:#666666"> <input type="radio" name="optionsRadios" value="男" >男
                </label>
                <label class="radio-inline" style="color:#666666"><input type="radio" name="optionsRadios" value="女" >女
                </label>
            </div>

        </div>
        <div class="form-group" >
            <div class="col-md-5"></div>
            <div class="col-md-7">
                <label class="checkbox-inline" id="che" style="color:#666666"><input type="checkbox" name="serpro" onclick="cheakser()" >我已阅读并同意<a href="" class="navbar-link">服务协议</a></label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-5"></label>
            <div class="col-md-3" style="left:50px">
                <a href="logintest.html"><button type="button" class="btn btn-primary" style="margin:0 50px 0 -70px;padding:6px 25px">登陆</button></a>

                <button type="submit" style="margin:0 -150px 0 0;" class="btn btn-primary" id="btn4">提交注册</button>
            </div>

        </div>
    </form></div>
</body>